package cn.zhc.com.utils;

import com.google.gson.Gson;

import java.lang.reflect.Type;

/**
 * Created by zhouhongchun on 2017/8/14.
 */
public class UtilsGson {
    private static Gson mGson = new Gson();


    public static <T> T fromJson(String json, Class<T> clz){
        return mGson.fromJson(json, clz);
    }
//    List<CarSourceInfo> data = GsonUtils.fromJson(networkBean.getData(), new TypeToken<List<CarSourceInfo>>() {
//    }.getType());
    public static <T> T fromJson(String json, Type type){
        return mGson.fromJson(json, type);
    }


    public static String toJson(Object object){
        return mGson.toJson(object);
    }
}
